/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 * Copyright 2008 Rhythm Computing All rights reserved.
 * 
 * Validatable.java	
 * @date: Oct 12, 2008
 * @author Michael J. Lee
 * 
 */
package com.rhythm.commons.validation;

/**
 * Implementing this inteface indicates an object contains states in which
 * its contents are considered valid or invalid.
 * <p>
 * <u><strong>IMPLEMENTATION RULES</strong></u><br/>
 * 1.) When <code>isValid</code> returns <code>false</code> then <code>getValiditionMessages()
 * </code> must return at least one message.<br/>
 * 2.) When <code>getValiditionMessages()</code> returns an empty instance then
 * <code>isValid()</code> MUST return <code>true</code><
 * </p>
 * 
 * @see Validator
 * @author Michael J. Lee
 * @since 1.0
 */
public interface Validatable<T> {
    
  /**
   * Checks the current state of the object and returns if its contents
   * are valid (true) or not valid (false).  This method will not explain any
   * of the rules broken durning the check if this is required see getValiditionMessages()
   * 
   * 
   * @return True if the current state of the object is valid, otherwise false.
   * @see getValiditionMessages()
   * 
   */
  public void checkState(Validator<T> validator) throws InvalidStateException;

  
}